<% if @node.has_mailing_list? %>
<div class="card bg-light">
  <div class='card-body'>
    <% mailing_list = @node.power_tag("list") %>

    <form action="https://groups.google.com/group/<%= mailing_list %>/boxsubscribe">
      <label><%= raw translation('sidebar._list.mailing_list', :mailing_list => mailing_list, :url1 =>"https://groups.google.com/group/"+mailing_list ) %>:</label>
      <div class="input-group">
        <span class="input-group-addon"><i class="fa fa-envelope"></i></span><input name="email" class="col-md-11 form-control" type="text" placeholder="you@email.com" />
      </div>
      <br />
      <button name="sub" type="submit" class="btn btn-primary"><%= translation('sidebar._list.subscribe') %></button>
    </form>

    <hr />
    <h4><%= translation('sidebar._list.recent_discussion_topics') %></h4>

    <ul class="nav bullet">
    <% @node.mailing_list[0..4].each do |item| %>
      <li>
        <a href="<%= item.link %>"><i class="fa fa-comment"></i> <%= item.title.gsub('Re: ','').gsub('['+mailing_list+']','') %></a>
        <p><small><i><%= distance_of_time_in_words(item.pubDate, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %></i></small></p>
      </li>
    <% end %>
    </ul>
    <p><a href="https://groups.google.com/group/<%= mailing_list %>"><%= translation('sidebar._list.all_topics') %> &raquo;</a></p>
  </div>
<% end %>
